home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / unix / mips / sysdep.h < prev    next >
C/C++ Source or Header  |  1993-08-26  |  2KB  |  68 lines

  1. /* Copyright (C) 1992 Free Software Foundation, Inc.
  2.    Contributed by Brendan Kehoe (brendan@zen.org).
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #include <sysdeps/unix/sysdep.h>
  20. #include <regdef.h>
  21.  
  22. #ifdef __STDC__
  23. #define ENTRY(name) \
  24.   .globl name;                                      \
  25.   .align 2;                                      \
  26.   name##:
  27. #else
  28. #define ENTRY(name) \
  29.   .globl name;                                      \
  30.   .align 2;                                      \
  31.   name/**/:
  32. #endif
  33.  
  34. /* Note that while it's better structurally, going back to call syscall_error
  35.    can make things confusing if you're debugging---it looks like it's jumping
  36.    backwards into the previous fn.  */
  37. #ifdef __STDC__
  38. #define PSEUDO(name, syscall_name, args) \
  39.   .set noreorder;                                  \
  40.   .align 2;                                      \
  41.   99: j syscall_error;                                  \
  42.   nop;                                                \
  43.   ENTRY(name)                                      \
  44.   li v0, SYS_##syscall_name;                              \
  45.   syscall;                                      \
  46.   bne a3, zero, 99b;                                  \
  47.   nop;                                          \
  48. syse1:
  49. #else
  50. #define PSEUDO(name, syscall_name, args) \
  51.   .set noreorder;                                  \
  52.   .align 2;                                      \
  53.   99: j syscall_error;                                  \
  54.   nop;                                                \
  55.   ENTRY(name)                                      \
  56.   li v0, SYS_/**/syscall_name;                              \
  57.   syscall;                                      \
  58.   bne a3, zero, 99b;                                  \
  59.   nop;                                          \
  60. syse1:
  61. #endif
  62.  
  63. #define ret    j ra ; nop
  64. #define r0    v0
  65. #define r1    v1
  66. /* The mips move insn is d,s.  */
  67. #define MOVE(x,y)    move y , x
  68.